package com.patterns.mediator;

/**
 * 研发部
 * @author huangke
 *
 */
public class DevelopmentDepartment implements Department{
	
	private Mediator mediator;//持有中介者（总经理）的引用
	
	public DevelopmentDepartment(Mediator mediator) {
		this.mediator = mediator;
		mediator.register("development", this);//向中介者注册
	}
	
	/**
	 * 本职工作
	 */
	public void selfAction() {
		System.out.println("研发部:写代码");
	}
	
	/**
	 * 向总经理要工资
	 */
	public void outerAction() {
		System.out.println("研发部:该发工资了,老板!");
		this.mediator.command("finacial");
	}

}
